import {ServerInfo} from "@/config/ServerInfoConfig.js";
import {iconList} from "@/components/IconData.js";

export const menuTableOption = {
    stripe: true, //条纹
    addBtn: false,
    viewBtn: true,
    searchIndex: 3,
    searchIcon: true,
    height: '68vh',
    selection: true, //多选
    reserveSelection: true, //翻页多选
    index: true, //加序号
    showSummary: true, //展开底部求和
    menuType: 'icon', // 操作栏改为图标展示
    loadingText: "数据加载中...",
    emptyText: '数据空空如也...',
    column: [
        {
            label: '主键', prop: 'id',
            display: false, hide: true
        },
        {
            label: '菜单名称',
            prop: 'name',
            rules: [{required: true, message: '请输入菜单名称', trigger: 'blur'}]

        },
        {
            label: '图标',
            prop: 'icon',
            type: 'icon',
            iconList:iconList
        },
        {
            label: '菜单路由',
            prop: 'routePath',
            rules: [{required: true, message: '请输入菜单名称', trigger: 'blur'}]

        },
        {
            label: '组件地址',
            prop: 'component'
        },
        {
            label: '排序',
            prop: 'sort',
            type: 'number',
            rules: [{required: true, message: '请输入菜单名称', trigger: 'blur'}]

        },
        {
            label: '状态',
            prop: 'status',
            props: {
                label: 'key',
                value: 'value'
            },
            dicUrl: `${ServerInfo.BASE_URL}/common/menuStatusEnum`
        },
        {
            label: '备注',
            prop: 'remark',
            type: 'textarea',
            span: 24
        },

    ]
}

export const menuFormOption = {
    labelWidth: 120,
    column: [
        {
            label: '菜单名称',
            prop: 'name',
            rules: [{required: true, message: '请输入菜单名称', trigger: 'blur'}]

        },
        {
            label: '菜单路由',
            prop: 'routePath',
            rules: [{required: true, message: '请输入菜单路由', trigger: 'blur'}]
        },
        {
            label: '组件地址',
            prop: 'component'
        },
        {
            label: '图标',
            prop: 'icon',
            type: 'icon',
            iconList:iconList
        },
        {
            label: '排序',
            prop: 'sort',
            type: 'number',
            value: 0,
            rules: [{required: true, message: '请输入排序号', trigger: 'blur'}]
        },
        {
            label: '状态',
            prop: 'status',
            value: 0,
            type:'select',
            props: {
                label: 'key',
                value: 'value'
            },
            dicUrl: `${ServerInfo.BASE_URL}/common/menuStatusEnum`

        },
        {
            label: '备注',
            prop: 'remark',
            type: 'textarea',
            span: 24
        },
    ]
}

